import { stringify } from 'qs';
import request from '@/utils/request';

export async function menuTree(params) {
    let url = `/iot/dmp/v1/permissions/tree`
    return request(url, {
        method: 'POST',
        body: {
            ...params
        },
    })
}
export async function menuList(params) {
    let url = `/iot/dmp/v1/permissions/list`
    return request(url, {
        method: 'POST',
        body: {
            ...params
        },
    })
}
export async function createMenu(params) {
    let url = `/iot/dmp/v1/permissions/insert`
    return request(url, {
        method: 'POST',
        body: {
            ...params
        },
    })
}

export async function updateMenu(params) {
    let url = `/iot/dmp/v1/permissions/updata`

    return request(url, {
        method: 'POST',
        body: {
            ...params
        },
    })
}

export async function deleteMenu(params) {
    let path = `/iot/dmp/v1/permissions/delete/${params.permission_id}`
    return request(path);
}

export async function platformtypeName() {
    let path = `/iot/dmp/v1/selectBaseDictByType/PLATFORM_TYPE`
    return request(path);
}

export async function detailMenu(params) {
    let path = `/iot/dmp/v1/permissions/getPermissionInfo/${params.per_id}`
    return request(path);
}
